<?$fecha = date("d")."-".date("m")."-".date("Y");
include ("../conectarse.php");
$documento = $_POST['documento'];
if($_GET['documento']!=""){$documento = $_GET['documento'];}
$consulta = "select * from mutuales where mut_cuit like $documento";
$resultado = mysql_query($consulta);
$fila = mysql_fetch_array($resultado);

$nombre = $fila['mut_nombre'];
$matricula = $fila['mut_matricula'];
$descuento = $fila['mut_descuento'];
$cuit = $fila['mut_cuit'];
$provincia = $fila['mut_provincia'];
$partido = $fila['mut_partido'];
$localidad = $fila['mut_localidad'];
$calle = $fila['mut_calle'];
$altura = $fila['mut_altura'];
$piso = $fila['mut_piso'];
$departamento = $fila['mut_departamento'];
$codigopostal = $fila['mut_codigopostal'];
$correo = $fila['mut_correo'];
$nombreresponsable = $fila['mut_nombre_responsable'];
$apellidoresponsable = $fila['mut_apellido_responsable'];
$cargoresponsable = $fila['mut_cargo_responsable'];
$cuitresponsable = $fila['mut_cuit_responsable'];
$telefono = $fila['mut_telefono'];
$cantidadafiliados = $fila['mut_af'];
$id = $fila['mut_id'];

?>
<body bgcolor = "#005F8C" alink = "white" vlink = "white" link = "white" text = "white">
<table width  ="100%" height = "100%" cellpadding = "0" cellspacing = "0">

<tr valign = "top">

<td align = "center">

<!--BARRA                    -->

<?include ("./barra/barramutual.php");?>

<!-- FIN DE LA BARRA                    -->
</td>


</tr>


<tr valign = "top" height = "100%"><td align = "left">

<!-- CUERPO DEL SISTEMA -->
<table cellpadding = "0" cellspacing = "0" border  ="0" height = "100%">
<tr valign = "middle"><td bgcolor = "black">


<?include ("links.php");?>



<!-- FIN DEL CUERPO DEL SISTEMA -->








</td><form method = "POST" action="cuotas.php?idmutual=<?echo $id?>"><td width = "100%" ALIGN = "CENTER"><br>

<table height = "100%"><TR valign="top"><TD>
<table border ="2" cellspacing = "0" cellpadding = "0" bordercolor = "white">
<tr><td>




        <table><tr><td colspan  ="4"></td></tr>

  <tr><td colspan  = "4" align="center"><b>MUTUAL <input type = "submit" value = "Cuotas"></td></tr>
  
   
  <tr><td colspan  = "4"><hr></td></tr>
        <tr>
        <td>Nombre:</td>
        <td><input type = "text" name = "nombre" value = "<?echo $nombre;?>" disabled="disabled"></td>
        <td>Matricula INAES:</td>
        <td><input type = "text" name = "matricula" value = "<?echo $matricula;?>" disabled="disabled"></td>
        </tr>


        <tr>
      
        <td>Codigo de Descuento:</td>
        <td><input type = "text" name = "descuento" value = "<?echo $descuento;?>" disabled="disabled"></td>
        <td>Cuit:</td>
        <td><input type = "text" name = "cuit" value = "<?echo $cuit;?>" disabled="disabled"></td>
        </tr>


                <tr><td colspan  ="4"><hr></td></tr>
  <tr><td colspan  = "4" align="center"><b>Detalles</td></tr>
                <tr><td colspan  ="4"><hr></td></tr>

 <tr>
        <td>Provincia:</td>
        <td>

<select name = "provincia" onchange="this.form.submit()" disabled="disabled">




<?$busquedaprov = "select * from provincias order by nombre Asc";
$resultadoprov = mysql_query($busquedaprov);
while($filaprov=mysql_fetch_array($resultadoprov)){?>


<option value = "<?echo $filaprov['0']?>" <?if($filaprov['0']==$provincia){echo "selected";}?>><?echo $filaprov['nombre']?></option>

<?}?>

</select>


</td>
        <td>Partido:</td>
        <td>

<select name = "partido" onchange="this.form.submit()" disabled="disabled">




<?$busquedapar = "select * from departamentos where provincia_id = $provincia order by nombre Asc";
$resultadopar = mysql_query($busquedapar);
while($filapar=mysql_fetch_array($resultadopar)){?>


<option value = "<?echo $filapar['0']?>" <?if($filapar['0']==$partido){echo "selected";}?>><?echo $filapar['nombre']?></option>

<?}?>

</select>

</td>
        </tr>

  <tr>
        <td>Localidad:</td>
        <td>




<select name = "localidad" onchange="this.form.submit()" disabled="disabled">




<?$busquedalocal = "select * from localidades where departamento_id = $partido order by nombre Asc";
$resultadolocal = mysql_query($busquedalocal);
while($filalocal=mysql_fetch_array($resultadolocal)){?>


<option value = "<?echo $filalocal['0']?>" <?if($filalocal['0']==$localidad){echo "selected";}?>><?echo $filalocal['nombre']?></option>

<?}?>

</select>





</td></form><form action  = "guardarcambiosmutual.php" method = "POST">
        <td>Calle:</td>
        <td><input type = "text" name = "calle" value = "<?echo $calle;?>"></td>
        </tr>

         <tr>
        <td>Altura:</td>
        <td><input type = "text" name = "altura" value = "<?echo $altura;?>"></td>
        <td>Piso:</td>
        <td><input type = "text" name = "piso" value = "<?echo $piso;?>"></td>
        </tr>


        <tr>
        <td>Dto:</td>
        <td><input type = "text" name = "departamento" value = "<?echo $departamento;?>" ></td>
        <td>Codigo Postal:</td>
        <td><input type = "text" name = "codigopostal" value = "<?echo $codigopostal;?>"></td>
        </tr>

 <tr>
        <td>Telefono:</td>
        <td><input type = "text" name = "telefono" value = "<?echo $telefono;?>"></td>
        <td>Correo:</td>
        <td><input type = "text" name = "correo" value = "<?echo $correo;?>"></td>
        </tr>


   
                <tr><td colspan  ="4"><hr></td></tr>
  <tr><td colspan  = "4" align="center"><b>Responsable</td></tr>
                <tr><td colspan  ="4"><hr></td></tr>

 <tr>
        <td>Nombre:</td>
        <td><input type = "text" name = "nombreresponsable" value = "<?echo $nombreresponsable;?>" ></td>
        <td>Apellido:</td>
        <td><input type = "text" name = "apellidoresponsable" value = "<?echo $apellidoresponsable;?>"></td>
        </tr>
 <tr>
        <td>Cargo:</td>
        <td><input type = "text" name = "cargoresponsable" value = "<?echo $cargoresponsable;?>" ></td>
        <td>Cuit:</td>
        <td><input type = "text" name = "cuitresponsable" value = "<?echo $cuitresponsable;?>"></td>
        </tr>

 <tr>
        <td>Afiliados:</td>
        <td><input type = "text" name = "cantidadafiliados" value = "<?echo $cantidadafiliados;?>" ></td>
<td></td><td></td>
        </tr>



                <tr><td colspan  ="4"><hr></td></tr>
  <input type = "hidden" name = "id" value = "<?echo $id;?>">
  <input type = "hidden" name = "documento" value = "<?echo $cuit;?>">
  
  <tr>
  <TD COLSPAN = "4" ALIGN = "center"><input type = "submit" value = "Guardar"></td></tr>
</form><form action  = "index.php" method = "POST">




  <tr>
  <TD COLSPAN = "4" ALIGN = "CENTER"><input type = "submit" value = "Cerrar"></td></tr>









</form></tr></table>












</TD></TR></table>




















</td></tr></table>




























</td>
</td></tr>

</table>
